<?php

//error_reporting(0);

session_start();
require_once(dirname(dirname(__FILE__))."/include/init.php");
require_once(dirname(dirname(__FILE__))."/include/mysql.php");
require_once(dirname(dirname(__FILE__))."/include/function.php");
    if($webconfig['login_wx_open']){//微信开始
if ($_SESSION['openid'] == ''){
	echo "<script>location.href='wxlogin.php';</script>";
}else{

    if ($_SESSION['eptime_id'] == ''){
        $aa_openid=$_SESSION['openid'];  
     	$data	=$con->find("select * from #__admin where openid='".$aa_openid."'");
    	if(!empty($data)){
		$_SESSION['eptime_id']=$data['ID'];
		$_SESSION['eptime_username']=$data['UserName'];
		$_SESSION['eptime_adminPower']=$data['AdminPower'];
		$_SESSION['eptime_l_zhanghu']=$data['zhanghu'];
		$_SESSION['eptime_l_xiangmu']=$data['xiangmu'];
		$_SESSION['eptime_l_wanglai']=$data['wanglai'];
		$_SESSION['eptime_l_yuangong']=$data['yuangong'];
		$_SESSION['eptime_flag']=$data['flag'];
		$_SESSION['eptime_img']=$data['img'];
		LYG::writeLog("[".$_SESSION['eptime_username']."]登陆后台成功！");
    	}else{
		//LYG::ShowMsg('请先绑定账号!');
		lyg::jump("login.php"); 
     	} 
    }
			
}
    }
LYG::checkloginm();
